package com.cv.platform.framework.web.core.runner;

import com.cv.platform.service.search.CvVideoSearchService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 服务启动时，同步数据库的视频信息到 ElasticSearch 中
 *
 * @author Charles_XDXD
 */
@Component
public class DataSyncRunner implements CommandLineRunner {

    @Resource
    private CvVideoSearchService cvVideoSearchService;
    
    @Override
    public void run(String... args) throws Exception {
        cvVideoSearchService.syncData();
    }

}
